package com.hainiu.cat.util;

/**
 * create by biji.zhao on 2021/5/30
 */
public class SortUtil {

    public static String arrayToString(int[] nums) {
        StringBuilder builder = new StringBuilder();
        for (int i = 0; i < nums.length; i++) {
            if (i < nums.length - 1) {
                builder.append(nums[i]).append(",");
            }else {
                builder.append(nums[i]);
            }
        }
        System.out.println(builder.toString());
        return builder.toString();
    }


    public static void swap(int[] array, int i, int j) {
        int temp = array[j];
        array[j] = array[i];
        array[i] = temp;
    }
}
